define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
    var Controller = {
        index: function () {
            // 初始化表格参数配置
            Table.api.init({
                extend: {
                    index_url: 'yihu/nursing/task/index' + location.search,
                    table: 'yihu_nursing_task',
                }
            });
            var table = $("#table");
            // 初始化表格
            table.bootstrapTable({
                url: $.fn.bootstrapTable.defaults.extend.index_url,
                pk: 't.id',
                sortName: 't.id',
                // fixedColumns: true,
                // fixedRightNumber: 1,
                // searchFormVisible:false,
                columns: [
                    [
                        {field: 'elderly_name', title: '长者姓名', operate: false},
                        {field: 'home_street', title: '家庭住址',operate:false},
                        {field: 'disability_level_name', title: '失能等级',operate:false},
                        {field: 'title', title: '服务项目',operate:false},
                        {field: 'finish_time', title: '护理时间', operate: false},
                        {field: 'images', title: '图片', operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images,operate:false},
                        // {field: 'company_name', title: '机构名称'},
                        {field: 'username', title: '护理员', operate: false},
                    ]
                ],
                buttons: [], // 清空 buttons 以移除默认的导出按钮
            });
            // 为表格绑定事件
            Table.api.bindevent(table);
            // 在控制器的JavaScript部分添加
            $(".fixed-table-toolbar").hide();
        }
    };
    return Controller;
});
